package com.hdax.dm.controller;

import com.hdax.dm.dto.CommonResponse;
import com.hdax.dm.dto.DtoUtil;
import com.hdax.dm.service.SchedulerService;
import com.hdax.dm.vo.TimePlanVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
public class SchedulerController {

    @Autowired
    private SchedulerService schedulerService;

    @PostMapping(path = "/getTimePlan")
    public CommonResponse<List<TimePlanVo>> getTimePlan(@RequestBody Map<String,Long> params){
        Long itemId = params.get("itemId");
        return DtoUtil.returnSuccess("",schedulerService.getTimePlan(itemId));
    }

}
